package com.ztao.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.user.dto.LoginDto;
import com.heima.model.common.user.pojos.ApUser;
import com.ztao.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
@Api(tags = "app端用户登录")
@RestController
@RequestMapping("/api/v1/login")
@Slf4j
public class UserController {
    @Resource
    private UserService userService;
    @ApiOperation("app端登录方法")
    @PostMapping("/login_auth")
    public ResponseResult login(@RequestBody LoginDto dto){
        log.info("用户登录{},{},{}","参数1","参数2");
        log.info("用户登录{},{},{}","参数a","参数b","参数c");
        return  this.userService.login(dto);
    }

    @PostMapping("/register")
    public ResponseResult register(@RequestBody ApUser apUser){
        return  this.userService.register(apUser);
    }

}
